﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace VietImage.Models
{
    public partial class Language
    {
        #region Properties
        #endregion

        #region Methods
        #endregion

        #region Static Methods
        public static List<Language> GetList()
        {
            VietImageDataClassesDataContext _db = new VietImageDataClassesDataContext();
            var v = _db.Languages.OrderBy(p => p.ID);
            if (v.Count() == 0)
                return null;
            return v.ToList();
        }

        private static List<ErrorItem> InputInfomationValidation(Language language)
        {
            List<ErrorItem> errorList = new List<ErrorItem>();
            if (language.Language1 == "")
                errorList.Add(new ErrorItem("Language1", "Language is required."));
            if (language.Language1.Length > 20)
                errorList.Add(new ErrorItem("Language1", "Language is only allow up to 20 characters."));
            return errorList;
        }
        #endregion
    }
}